package cn.edu.zjicm.wordsnet_d.data.test;

import android.util.Log;
import cn.edu.zjicm.wordsnet_d.data.OneWord;

public class QuestionMode {
	//熟悉度1
	public static QuestionMode mode0=new QuestionMode(0, 1, 10, false, 0, OneWord.SENSE_DEGREE_TOO_EASY, true, 10);	// 10 继续学习  100 太简单	太简单获得10个经验值
	
	public static QuestionMode mode10=new QuestionMode(10, 5, 11, false, 0, 10, false, 0); 
	public static QuestionMode mode11=new QuestionMode(11, 4, 12, false, 0, 11, false, 0); 
	public static QuestionMode mode12=new QuestionMode(12, 2, 20, true,  10,13, false, 0);	//正确获得10个经验值 
	public static QuestionMode mode13=new QuestionMode(13, 4, 12, false, 0, 13, false, 0); 
	
	//熟悉度2
	public static QuestionMode mode20=new QuestionMode(20, 2, 22, false, 0, 21, false, 0);	
	public static QuestionMode mode21=new QuestionMode(21, 5, 23, false, 0, 21, false, 0); 
	public static QuestionMode mode22=new QuestionMode(22, 5, 30, true,  10,22, false, 0);  //正确获得10个经验值
	public static QuestionMode mode23=new QuestionMode(23, 2, 20, true,  0, 24, false, 0); 
	public static QuestionMode mode24=new QuestionMode(24, 4, 23, false, 0, 24, false, 0); 

	//熟悉度3
	public static QuestionMode mode30=new QuestionMode(30, 2, 32, false, 0, 31, false, 0);	
	public static QuestionMode mode31=new QuestionMode(31, 5, 33, false, 0, 31, false, 0); 
	public static QuestionMode mode32=new QuestionMode(32, 5, 40, true,  10,32, false, 0); 	//正确获得10个经验值
	public static QuestionMode mode33=new QuestionMode(33, 2, 20, true, -10,34, false, 0); 	//错误减去10个经验值
	public static QuestionMode mode34=new QuestionMode(34, 4, 33, false, 0, 34, false, 0); 
	
	//熟悉度4
	public static QuestionMode mode40=new QuestionMode(40, 2, 60, true, 10, 41, false, 0); 
	public static QuestionMode mode41=new QuestionMode(41, 2, 43, false, 0, 41, false, 0); 
//	public static QuestionMode mode42=       new QuestionMode(42, 5, 60, true, 10, 42, false, 0); 	//正确获得10个经验值
//	public static QuestionMode mode42_phrase=new QuestionMode(42, 5, 60, true, 10, 42, false, 0); 	//正确获得10个经验值
	public static QuestionMode mode43=new QuestionMode(43, 2, 30, true,-10, 44, false, 0); 	//错误减去10个经验值
	public static QuestionMode mode44=new QuestionMode(44, 4, 43, false, 0, 44, false, 0);

	//原来的熟悉度5
	public static QuestionMode mode50=new QuestionMode(50, 2, 60, true, 10, 51, false, 0); 	//正确获得10个经验值
	public static QuestionMode mode51=new QuestionMode(51, 5, 52, false, 0, 51, false, 0); 
	public static QuestionMode mode52=new QuestionMode(52, 2, 40, true,-10, 53, false, 0); 	//错误减去10个经验值
	public static QuestionMode mode53=new QuestionMode(53, 5, 52, false, 0, 53, false, 0);
	
	public static QuestionMode getQuestionMode(int sense_degree_fm, int lemma_type) {
		switch (sense_degree_fm) {
		case 0:	return mode0;
		case 10:return mode10;
		case 11:return mode11;
		case 12:return mode12;
		case 13:return mode13;
		case 20:return mode20;
		case 21:return mode21;
		case 22:return mode22;
		case 23:return mode23;
		case 24:return mode24;
		case 25:return mode22;	//避免原来没有搭配，现在有搭配，产生空指针异常
		case 30:return mode30;
		case 31:return mode31;
		case 32:return mode32;
		case 33:return mode33;
		case 34:return mode34;
		case 35:return mode32;	//避免原来没有搭配，现在有搭配，产生空指针异常
		case 40:return mode40;
		case 41:return mode41;
		case 42:
				return mode41;
		case 43:return mode43;
		case 44:return mode44;
		case 45:				//避免原来没有搭配，现在有搭配，产生空指针异常
				return mode41;	
		case 50:return mode50;
		case 51:return mode51;
		case 52:return mode52;
		case 53:return mode53;
		case 55:return mode51;	//避免原来没有搭配，现在有搭配，产生空指针异常
		}
		return null;
	}
	
	//熟悉度1
	public static QuestionMode mode0WithOutRelationship=new QuestionMode(0, 1, 10,  false, 0, OneWord.SENSE_DEGREE_TOO_EASY, true, 10);// 10 继续学习  100 太简单	太简单获得10个经验值
	
	public static QuestionMode mode10WithOutRelationship=new QuestionMode(10, 2, 20, true, 10, 20, true, 10);	//不管正确，都获得10个经验值
	
	//熟悉度2
	public static QuestionMode mode20WithOutRelationship=new QuestionMode(20, 2, 30, true, 10, 25, false, 0);	//正确获得10个经验值
	public static QuestionMode mode25WithOutRelationship=new QuestionMode(25, 2, 20, true, 0,  25, false, 0);			
	
	//熟悉度3
	public static QuestionMode mode30WithOutRelationship=new QuestionMode(30, 2, 40, true, 10, 35, false, 0);	//正确获得10个经验值
	public static QuestionMode mode35WithOutRelationship=new QuestionMode(35, 2, 20, true,-10, 35, false, 0);	//错误减去10个经验值
	
	//熟悉度4
	public static QuestionMode mode40WithOutRelationship=new QuestionMode(40, 2, 60, true, 10, 45, false, 0);	//正确获得10个经验值
	public static QuestionMode mode45WithOutRelationship=new QuestionMode(45, 2, 30, true,-10, 45, false, 0);	//错误减去10个经验值

	//原来的熟悉度5
	public static QuestionMode mode50WithOutRelationship=new QuestionMode(50, 2, 60, true, 10, 55, false, 0);	//正确获得10个经验值
	public static QuestionMode mode55WithOutRelationship=new QuestionMode(55, 2, 40, true,-10, 55, false, 0);	//错误减去10个经验值
	
	public static QuestionMode getQuestionModeWithoutRelationship(int sense_degree_fm, int lemma_type) {
		switch (sense_degree_fm) {
		case 0:	return mode0WithOutRelationship;
		case 10:return mode10WithOutRelationship;		
		case 20:return mode20WithOutRelationship;
		case 25:return mode25WithOutRelationship;		
		case 30:return mode30WithOutRelationship;
		case 35:return mode35WithOutRelationship;		
		case 40:
				return mode40WithOutRelationship;
		case 45:return mode45WithOutRelationship;		
		case 50:return mode50WithOutRelationship;
		case 55:return mode55WithOutRelationship;
		}
		switch (sense_degree_fm / 10 * 10) {	//避免原来有搭配，现在没搭配，产生空指针异常
		case 0:	return mode0WithOutRelationship;
		case 10:return mode10WithOutRelationship;		
		case 20:return mode20WithOutRelationship;
		case 30:return mode30WithOutRelationship;
		case 40:
				return mode40WithOutRelationship;
		case 50:return mode50WithOutRelationship;
		}
		return null;
	}

	
	int oldDegree;								//单词原熟悉度	
	int testMode;								//测试模式	
	int nextDegreeAfterRightAnswer;				//回答正确后熟悉度应变化为的值	
	boolean finishCurWordTestAfterRightAnswer;	//回答正确后此单词是否继续学习
	int expChangeAfterRightAnswer;				//回答正确后获得的经验值
	int nextDegreeAfterWrongAnswer;				//回答错误后熟悉度应变化为的值	
	boolean finishCurWordTestAfterWrongAnswer;	//回答错误后此单词是否继续学习
	int expChangeAfterWrongAnswer;				//回答错误后获得的经验值
	
	public QuestionMode(int oldDegree, int testMode, 
			int nextDegreeAfterRightAnswer, boolean finishCurWordTestAfterRightAnswer, int expChangeAfterRightAnswer,
			int nextDegreeAfterWrongAnswer, boolean finishCurWordTestAfterWrongAnswer, int expChangeAfterWrongAnswer) {
		this.oldDegree = oldDegree;
		this.testMode = testMode;
		this.nextDegreeAfterRightAnswer = nextDegreeAfterRightAnswer;
		this.finishCurWordTestAfterRightAnswer = finishCurWordTestAfterRightAnswer;
		this.expChangeAfterRightAnswer = expChangeAfterRightAnswer;
		this.nextDegreeAfterWrongAnswer = nextDegreeAfterWrongAnswer;
		this.finishCurWordTestAfterWrongAnswer = finishCurWordTestAfterWrongAnswer;
		this.expChangeAfterWrongAnswer = expChangeAfterWrongAnswer;
	}	
	
	public int getExpChangeAfterRightAnswer() {
		return expChangeAfterRightAnswer;
	}

	public void setExpChangeAfterRightAnswer(int expChangeAfterRightAnswer) {
		this.expChangeAfterRightAnswer = expChangeAfterRightAnswer;
	}

	public int getExpChangeAfterWrongAnswer() {
		return expChangeAfterWrongAnswer;
	}

	public void setExpChangeAfterWrongAnswer(int expChangeAfterWrongAnswer) {
		this.expChangeAfterWrongAnswer = expChangeAfterWrongAnswer;
	}

	public int getOldDegree() {
		return oldDegree;
	}

	public void setOldDegree(int oldDegree) {
		this.oldDegree = oldDegree;
	}

	public int getTestMode() {
		return testMode;
	}

	public void setTestMode(int testMode) {
		this.testMode = testMode;
	}

	public int getNextDegreeAfterRightAnswer() {
		return nextDegreeAfterRightAnswer;
	}

	public void setNextDegreeAfterRightAnswer(int nextDegreeAfterRightAnswer) {
		this.nextDegreeAfterRightAnswer = nextDegreeAfterRightAnswer;
	}

	public int getNextDegreeAfterWrongAnswer() {
		return nextDegreeAfterWrongAnswer;
	}

	public void setNextDegreeAfterWrongAnswer(int nextDegreeAfterWrongAnswer) {
		this.nextDegreeAfterWrongAnswer = nextDegreeAfterWrongAnswer;
	}

	public boolean isFinishCurWordTestAfterRightAnswer() {
		return finishCurWordTestAfterRightAnswer;
	}

	public void setFinishCurWordTestAfterRightAnswer(
			boolean finishCurWordTestAfterRightAnswer) {
		this.finishCurWordTestAfterRightAnswer = finishCurWordTestAfterRightAnswer;
	}

	public boolean isFinishCurWordTestAfterWrongAnswer() {
		return finishCurWordTestAfterWrongAnswer;
	}

	public void setFinishCurWordTestAfterWrongAnswer(
			boolean finishCurWordTestAfterWrongAnswer) {
		this.finishCurWordTestAfterWrongAnswer = finishCurWordTestAfterWrongAnswer;
	}	
	
}
